package ar.edu.unicen.exa.oop.bbquery.view.mediators;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.text.JTextComponent;

import org.puremvc.java.multicore.patterns.mediator.Mediator;

import ar.edu.unicen.exa.oop.bbquery.facade.AppFacade;

public class TextComponentMediator extends Mediator implements ActionListener {

    public static final String NAME = "TextComponentMediator";
    
	public TextComponentMediator(JButton frm,JTextComponent txt) {
		super(NAME, txt);
		frm.addActionListener(this);
	}
	@Override
	public void actionPerformed(ActionEvent arg0) {
		this.sendNotification(AppFacade.DATA_SUBMITTED, viewComponent,((JTextComponent)viewComponent).getText());
	}
	
 
}
